Socket
Socket
Sign inDemoInstall

@fluentui/utilities

Package Overview
Dependencies
7
Maintainers
0
Versions
98
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/utilities


Version published
Maintainers
0
Created

Package description

What is @fluentui/utilities?

@fluentui/utilities is a utility library that provides a set of helper functions and utilities to assist with common tasks in JavaScript and React applications. It is part of the Fluent UI suite, which is a collection of libraries for building user interfaces.

What are @fluentui/utilities's main functionalities?

Event Handling

The EventGroup class helps manage event listeners, making it easier to add and remove them in a consistent manner.

const { EventGroup } = require('@fluentui/utilities');

const eventGroup = new EventGroup(this);
eventGroup.on(window, 'resize', () => {
  console.log('Window resized');
});

CSS Class Management

The css function helps concatenate CSS class names conditionally, making it easier to manage dynamic class names in your components.

const { css } = require('@fluentui/utilities');

const className = css('class1', 'class2', { 'class3': true, 'class4': false });
console.log(className); // Outputs: 'class1 class2 class3'

Object Merging

The assign function is used to merge multiple objects into one, similar to Object.assign but with additional features.

const { assign } = require('@fluentui/utilities');

const obj1 = { a: 1, b: 2 };
const obj2 = { b: 3, c: 4 };
const mergedObj = assign({}, obj1, obj2);
console.log(mergedObj); // Outputs: { a: 1, b: 3, c: 4 }

DOM Utilities

The getDocument function provides a safe way to access the document object, which is useful for server-side rendering scenarios.

const { getDocument } = require('@fluentui/utilities');

const doc = getDocument();
console.log(doc); // Outputs: [object Document]

Other packages similar to @fluentui/utilities

Readme

Source

@fluentui/utilities

Utilities for Fluent UI React (formerly Office UI Fabric React)

This package includes a number of basic utility functions required by most Fluent UI React components.

See GitHub for more details on the Fluent UI React project and packages within.

FAQs

Last updated on 25 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc